home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1997 February
/
EnigmA AMIGA RUN 15 (1997)(G.R. Edizioni)(IT)[!][issue 1997-02][PLANET CD V].iso
/
progs
/
editor
/
frexxed
/
fpl
/
precompile.fpl
< prev
next >
Wrap
Text File
|
1995-07-18
|
2KB
|
56 lines
int SearchCountA(string searchstring)
{
int foundcount=0;
GotoLine(1, 0);
while (Search(searchstring)>=0)
foundcount++;
return(foundcount);
}
export int PreCompile()
{
int BufferID=DuplicateEntry();
int currentbuffer=GetBufferID();
int foundcount1, foundcount2;
string result="";
if (BufferID) {
Status(0, "Wait...");
CurrentBuffer(BufferID);
foundcount1=SearchCountA("\"");
result=joinstr("'\"' is found ", ltostr(foundcount1), " times! ");
if (foundcount1 & 1)
result=joinstr(result, "Not good!");
else
result=joinstr(result, "Good!");
foundcount1=SearchCountA("{");
result=joinstr(result, "\n'{' is found ", ltostr(foundcount1), " times! ");
foundcount2=SearchCountA("}");
result=joinstr(result, "\n'}' is found ", ltostr(foundcount2), " times! ");
if (foundcount1!=foundcount2)
result=joinstr(result, "Not good!");
else
result=joinstr(result, "Good!");
foundcount1=SearchCountA("(");
result=joinstr(result, "\n'(' is found ", ltostr(foundcount1), " times! ");
foundcount2=SearchCountA(")");
result=joinstr(result, "\n')' is found ", ltostr(foundcount2), " times! ");
if (foundcount1!=foundcount2)
result=joinstr(result, "Not good!");
else
result=joinstr(result, "Good!");
CurrentBuffer(currentbuffer);
Kill(BufferID);
Status();
Request(result, "PreCompile", "Yeah!");
}
}
/* Assign "amiga control shift p" to the function */
AssignKey("PreCompile();", "amiga control shift p");